import 'package:flutter/material.dart';
import 'package:toast/toast.dart';

class CallPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MyCallPage();
  }
}

class MyCallPage extends StatefulWidget {
  @override
  _MyCallPageState createState() => _MyCallPageState();
}

class _MyCallPageState extends State<MyCallPage> {
  toCall() {
    Toast.show(
      "拨打电话",
      context,
      duration: Toast.LENGTH_LONG,
      gravity: Toast.CENTER,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView(
        children: [
          SizedBox(
            height: 20,
          ),
          RawMaterialButton(
            child: Card(
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Container(
                    padding: EdgeInsets.fromLTRB(30, 10, 0, 10),
                    child: Text(
                      "张三",
                      style: TextStyle(
                        color: Colors.blue,
                        fontSize: 18,
                      ),
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.only(right: 10),
                    child: Icon(
                      Icons.keyboard_arrow_right_outlined,
                      color: Colors.blue,
                    ),
                  ),
                ],
              ),
            ),
            onPressed: toCall,
          ),
        ],
      ),
      decoration: BoxDecoration(color: Color.fromRGBO(230, 230, 230, 1)),
    );
  }
}
